<?php

class m130915_120821_create_tbl_user extends CDbMigration
{
    public function up()
    {
        $this->createTable('tbl_user',array(
            'id' => 'pk',
            'name' => 'varchar(50) NOT NULL',
            'login' => 'varchar(50) NOT NULL',
            'email'=>'varchar(50) NOT NULL',
            'activationKey'=> 'varchar(40) NOT NULL',
            'password'=>'char(32) NOT NULL',
            'avatar'=>'varchar(50) NOT NULL',
            'create_time' => 'datetime DEFAULT NULL',
            'update_time'=>'datetime DEFAULT NULL',
            'create_user_id' => 'int(11) DEFAULT NULL',
            'update_user_id' => 'int(11) DEFAULT NULL',
            'role'=>'varchar(20) NOT NULL',
            'active'=>'boolean DEFAULT 0',
            'login_time'=>'datetime DEFAULT NULL',
            'last_login_time'=>'datetime DEFAULT NULL',
        ));
    }
    public function down()
    {
        $this->dropTable('tbl_user');
    }

    /*
    // Use safeUp/safeDown to do migration with transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}